# -*- coding: utf-8 -*-
# @Time    : 2024/2/20 22:14
# @Author  : micah
# @File    : 26.启动浏览器界面.py
# @Software: PyCharm


import asyncio
from pyppeteer import launch


# 设置浏览器显示的大小
width, height = 1366, 768


async def main():
    browser = await launch(headless=False, args=['--disable-infobars', f'--window-size={width},{height}'])
    page = await browser.newPage()
    await page.setViewport({'width': width, 'height': height})
    await page.goto('https://www.baidu.com')
    await asyncio.sleep(10)
    await browser.close()


asyncio.get_event_loop().run_until_complete(main())
